<?php
require_once('../../config.php');
Doctrine::loadModels('../../models');

if( $_REQUEST["image_id"])
{
	$image_id = strip_tags($_REQUEST["agent_address_id"]);
    $image_type_id = strip_tags($_REQUEST["type_id"]);
    $image_name = strip_tags($_REQUEST["image_name"]);
	$file_name = strip_tags($_REQUEST["file_name"]);
	$modified = date("Y-m-d H:m:s");
	 
	$db_query = sprintf("UPDATE agent_images 
							SET image_type_id='".$image_type_id."',	
								image_name='".$image_name."',
								file_name='".$file_name."', 
								modified='".$modified."'
							WHERE image_id='".$image_id."'");
 
 	file_put_contents  ( "image_update.txt", $db_query);   
 
 	$result = mysql_query($db_query);
    	if (!$result) {
        		die('invalid query');    // . mysql_error());
    		}
}

//mysql_free_result( $result )
	
?>